import { Sequelize } from 'sequelize'
const { 
    MYSQL_HOST,
    MYSQL_USER,
    MYSQL_DB ,
    MYSQL_PASSWORD
} = require('../config/config.default')
const seq = new Sequelize(MYSQL_DB, MYSQL_USER, MYSQL_PASSWORD, {
    host: MYSQL_HOST,
    dialect: 'mysql',
    define: {
        charset: 'utf8mb4',
        underscored: true
    }
})

// seq.authenticate().then(() => {
//     console.log('数据库连接成功')
// }).catch((err) => {
//     console.log('数据库连接失败', err)
// })

module.exports = seq